{{- define "main" -}}

{{ partial "page_header.html" . }}

<div class="universal-wrapper">
  {{ with .Content }}
    <div class="article-style">{{ . }}</div>
  {{ end }}


  {{ if templates.Exists (printf "partials/views/%s-start.html" (lower $.Params.view | default "compact")) }}
    {{ partial "functions/render_view" (dict "page" $ "item" . "view" (printf "%s-start" $.Params.view) "index" 0) }}
  {{ end }}

  {{ $paginator := .Paginate .Pages }}
  {{ range $index, $post := $paginator.Pages }}
    {{ partial "functions/render_view" (dict "page" $ "item" . "view" ($.Params.view | default "compact") "index" $index) }}
  {{end}}

  {{ if templates.Exists (printf "partials/views/%s-end.html" (lower $.Params.view | default "compact")) }}
    {{ partial "functions/render_view" (dict "page" $ "item" . "view" (printf "%s-end" $.Params.view) "index" 0) }}
  {{ end }}

  {{ partial "pagination" . }}
</div>

{{- end -}}
